package main

import (
	"fmt"
	"time"
)

//引入time包

func main() {
	now := time.Now()
	fmt.Println(now)                             //输出当前时间
	println(now.Year())                          //输出年份
	println(now.Month())                         //输出月份
	println(now.Day())                           //输出日期
	println(now.Hour())                          //输出时间
	println(now.Minute())                        //输出分钟
	println(now.Second())                        //输出秒
	fmt.Println(now.Format("02 Jan 2006 15:04")) //格式化输出
	fmt.Printf("%02d.%02d.%4d\n", now.Day(), now.Month(), now.Year())
}
